// f[i][j]表示考虑前i个数，并且总和恰好为j的方案数量
// f[i][j] = f[i - 1][j] + f[i - 1][j - v]

#include <iostream>
using namespace std;

const int N = 10010;
int f[N], n, m;

int main()
{
    cin >> n >> m;
    f[0] = 1;
    for (int i = 0; i < n; ++i)
    {
        int a;
        cin >> a;
        for (int j = m; j >= a; --j)
            f[j] += f[j - a];
    }
    cout << f[m] << endl;
    return 0;
}
